package net.oschina.app;

import android.util.Log;
import android.view.View;
import android.widget.EditText;

import com.robotium.solo.Solo;

import java.util.Date;

/**
 * Created by Administrator on 2018/3/19.
 */

public class SoloWrap {
        private Solo solo;

        public SoloWrap(Solo solo){
            this.solo=solo;
        }

        //封装常用的方法
        public void clickOnView(View view){
            Log.i("Auto","click on view"+view.getId());
//            solo.waitForView(view,1,500);
            solo.clickOnView(view);
        }
        public View getView(String id){
                return solo.getView(id);
        }

        public void clearEditText(EditText et){
            solo.clearEditText(et);
        }
        public void enterText(EditText et,String text){
            solo.enterText(et,text);
        }

        public  boolean searchText(String text){
           return solo.searchText(text,true);
        }

        public void sleep(int time){
            solo.sleep(time);
        }


    public Boolean waitForText(String text,int time){
            return solo.waitForText(text,1,time);
           // solo.takeScreenshot(name);
    }
    public void takeScreenshot(String name){//封装截图方法
        solo.takeScreenshot(name);
    }
}
